package com.taoban.shopdata.entity;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import com.yufei.utils.CommonUtil;
/**
 * @author jasstion
 * 上午11:05:42
 * 最总提交给spider-server的需要更行的商品id以及最新的价格信息
 * I表示商品信息（可以为任何数据结构），R表示利用数据结构获取到的商品信息结构
 */
@XmlRootElement
public class PriceUpdatedCommitResult<I,R> {
	public PriceUpdatedCommitResult(String mallType, List<I> itemInfos) {
		super();
		this.mallType = mallType;
		this.itemInfos = itemInfos;
	}


//amazon
private String mallType=null;
public String getMallType() {
	return mallType;
}
public PriceUpdatedCommitResult(String mallType, List<I> itemInfos,
		List<R> prices) {
	super();
	this.mallType = mallType;
	this.itemInfos = itemInfos;
	this.prices = prices;
}
@XmlElement
public void setMallType(String mallType) {
	this.mallType = mallType;
}
public PriceUpdatedCommitResult() {
		super();
		// TODO Auto-generated constructor stub
	}


private List<I> itemInfos=null;
private List<R> prices=null;


public List<R> getPrices() {
	return prices;
}
@XmlElementWrapper(name="prices")
@XmlElement(name="price")
public void setPrices(List<R> prices) {
	this.prices = prices;
}
public List<I> getItemInfos() {
	return itemInfos;
}
@XmlElementWrapper(name="itemInfos")
@XmlElement(name="itemInfo")
public void setItemInfos(List<I> itemInfos) {
	this.itemInfos = itemInfos;
}
public static void main(String[] args){
	PriceUpdatedCommitResult<String, Double> priceUpdatedCommitResult=new PriceUpdatedCommitResult<>();
	List<String> itemInfos1=new ArrayList<>();
	List<Double>		prices1=new ArrayList<>();
			itemInfos1.add("test");
			prices1.add(new Double(100));
			;
	priceUpdatedCommitResult.setItemInfos(itemInfos1);
	priceUpdatedCommitResult.setPrices(prices1);
	System.out.print(CommonUtil.generateXmlForObject(priceUpdatedCommitResult, PriceUpdatedCommitResult.class));
}
}
